<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <title>Document</title>
    <%--<%@include file="../../common.jsp"%>--%>
    &nbsp;
</head>
<body>
<form class="layui-form" action="" id="userForm" style="padding: 10px 15px;" lay-filter="userForm">
    <input type="hidden" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label">登录账号:</label>
        <div class="layui-input-inline">
            <input type="text" name="username" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" width="200" id="userName">
        </div>
        <div class="layui-form-mid layui-word-aux">登录账号不可重复!</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户名称:</label>
        <div class="layui-input-block">
            <input type="text" name="name" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" width="200">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">密码:</label>
        <div class="layui-input-block">
            <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input" width="300px">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">盐值:</label>
        <div class="layui-input-block">
            <input type="text" name="salt" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" width="300px">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">角色:</label>
        <div class="layui-input-block">
            <select name="roleStr" class="layui-select" id="role" xm-select="roles" width="300px">
                <option value="-1">请选择</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">性别:</label>
        <div class="layui-input-block">
            <input type="radio" name="sex" value="男" title="男" checked>
            <input type="radio" name="sex" value="女" title="女">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">年龄:</label>
        <div class="layui-input-block">
            <input type="text" name="age" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" width="300px">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">电话:</label>
        <div class="layui-input-block">
            <input type="text" name="phoneTel" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" width="300px">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱:</label>
        <div class="layui-input-block">
            <input type="text" name="email" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" width="300px">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否锁定:</label>
        <div class="layui-input-block">
            <input type="checkbox" name="userState" lay-skin="switch" value="1">
        </div>
    </div>
</form>
<script>
    layui.form.render();
    //显示角色信息
    $.get("${path}/role/selectRoleAll",function (data) {
        $.each(data,function () {
            var option = $('<option></option>').appendTo("#role");
            option.text(this.roleName).val(this.id);
        });
        layui.formSelects.render();
    });
</script>
</body>
</html>
